package com.trf.controller;

import com.trf.entity.Admin;
import com.trf.entity.R;
import com.trf.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 管理员的Controller
 *
 * @author 小小唐
 * @Date 2022/6/15-星期三-16:23
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private IAdminService adminService;

    /**
     * 查询管理员
     *
     * @return
     */
    @GetMapping("/findAdmin")
    public R findAdmin(){
        List<Admin> adminList = adminService.list();
        Map<String,Object> map = new HashMap<>();
        map.put("message",adminList);
        return R.ok(map);
    }
}
